<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport"
			content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<title>我的订阅</title>
		<link rel="stylesheet" href="/mobile/layui/css/layui.css" />
		<link rel="stylesheet" href="/mobile/css/mobile.css" />
		<script src="/mobile/js/jquery.min.js"></script>
		<script src="/mobile/layui/layui.js"></script>
	</head>
	<body>

		<ul class="order_nav">
			<li {if condition="request()->param('status/s')==''"} class="active"{/if}><a href="{:url('user/wode_dingyue')}">全部</a></li>
			<li {if condition="request()->param('status/s')=='0'"} class="active"{/if}><a href="{:url('user/wode_dingyue',['status'=>0])}">待付款</a></li>
			<li {if condition="request()->param('status/s')=='1'"} class="active"{/if}><a href="{:url('user/wode_dingyue',['status'=>1])}">待管理员确认</a></li>
			<li {if condition="request()->param('status/s')=='2'"} class="active"{/if}><a href="{:url('user/wode_dingyue',['status'=>2])}">已完成</a></li>
		</ul>
		<div class="bg_gray_main" style="min-height:100vh;">
			<ul class="order_list">
			    {volist name="rs" id="item"}
				<li>
					<div class="hd">
						<div>订阅单号：{$item.order_sn}</div>
						<div class="status">{$status_arr[$item.status]}</div>
					</div>
					<div class="bd">
						<div class="img" style="background-image: url({$item.image});"></div>
						<div class="content">
							<div class="title">{$item.name}</div>
							<div style="display:flex; justify-content: space-between;">
								<span class="layui-font-red">￥{$item.price}/每份</span>
								<span style="color:gray">X{$item.dinggoufenshu}</span>
							</div>

						</div>
					</div>
					<div class="ft">
						<div class="left layui-font-red" >
							总价 ￥{$item.money}
						</div>
						<div>
							<button type="button" class="layui-btn layui-btn-primary layui-btn-radius" onclick="view_order({$item.id})">查看</button>
							{if($item.status=='0')}
							<button type="button" class="layui-btn layui-btn-normal layui-btn-radius" onclick="pay_order({$item.id})">付款</button>
							{/if}
						</div>
					</div>
				</li>
				{/volist}

			</ul>

			<div style="text-align: center;">
    			{$rs->render()}
    		</div>
		</div>
		{include file="common/footer"}
	</body>
<script>
    function view_order(id){
        window.location.href="{:url('shukan/qikan_dingyue_dingdan')}?id="+id;
    }
    function pay_order(id){
        window.location.href="{:url('shukan/qikan_dingyue_fukuan')}?id="+id;
    }
</script>
</html>
